package com.best.jedis;

import redis.clients.jedis.Jedis;

/**
 * @author Jiang Akang
 * employeeId: BG435424
 * @date 2021/3/7
 **/
public class TestReplication {
    public static void main(String[] args) throws InterruptedException {
        Jedis jedis_M = new Jedis("127.0.0.1", 6379);
        Jedis jedis_S = new Jedis("127.0.0.1", 6380);

        jedis_S.slaveof("127.0.0.1", 6379);

        jedis_M.set("k6", "v6");
        Thread.sleep(500);
        System.out.println(jedis_S.get("k6"));
    }
}
